package cn.com.huzo.model.entities.oa;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 公告板实体类
 *
 * @author 吴旭
 */
public class BulletinEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 3152433706490055325L;
    private String BulletinId;       // 主键
    private Integer Channel;         // 0: 公司 1：部门
    private Short Priority;          // 优先级 0：紧急 1：高 2：普通
    private String Title;            // 标题
    private String Contents;         // 内容
    private Date StartTime;          // 开始时间
    private Date EndTime;            // 结束時間

    public String getBulletinId() {
        return BulletinId;
    }

    public void setBulletinId(String BulletinId) {
        this.BulletinId = BulletinId;
    }

    public Integer getChannel() {
        return Channel;
    }

    public void setChannel(Integer Channel) {
        this.Channel = Channel;
    }

    public Short getPriority() {
        return Priority;
    }

    public void setPriority(Short Priority) {
        this.Priority = Priority;
    }

    public String getTitle() {
        return Title;
    }

    public void setTitle(String Title) {
        this.Title = Title;
    }

    public String getContents() {
        return Contents;
    }

    public void setContents(String Contents) {
        this.Contents = Contents;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getStartTime() {
        return StartTime;
    }

    public void setStartTime(Date StartTime) {
        this.StartTime = StartTime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getEndTime() {
        return EndTime;
    }

    public void setEndTime(Date EndTime) {
        this.EndTime = EndTime;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof BulletinEntity)) {
            return false;
        }

        final BulletinEntity that = (BulletinEntity) o;

        return new EqualsBuilder()
                .append(this.getBulletinId(), that.getBulletinId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getBulletinId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
